package cn.doit.scala.day01.method

import scala.math.Ordering.Implicits.infixOrderingOps

/**
 * @DATE 2021/12/24/15:48
 * @Author MDK
 * @Version 2021.2.2
 * */
object C02_Function01 {
  //定义一个求两个整数和的函数
  val add = (x:Int, y:Int)=>{ x+y }
  val concat = (str1:String, str2:String)=>{ str1+"\t"+str2 }
  val maxfun=(a:Double, b:Double)=>{
    if(a>b){
      a
    }else{
      b
    }
  }

  def main(args: Array[String]): Unit = {
    println(add(2, 3))
    println(concat("i love", "study"))
    println(maxfun(3.23, 3.234))
  }
}
